package net.yxsoft.message.listener;

import com.jfinal.kit.StrKit;
import net.yxsoft.message.Message;
import net.yxsoft.message.MessageListener;
import net.yxsoft.message.annotation.Listener;
import net.yxsoft.model.infrastructure.TsLog;

@Listener(action = {TsLog.PUSH_LOG})
public class LogListener implements MessageListener {

    @Override
    public void onMessage(Message message) {

        Object obj = message.getData();

        if(StrKit.notNull(obj)){

            TsLog log = (TsLog) obj;
            log.save();
        }
    }
}
